import { requestClient } from '#/api/request';

export namespace AiApi {
  /** 文生图接口参数 */
  export interface TextToImageParams {
    prompt: string;
    size?: string;
    style?: string;
    creativity?: number;
  }

  /** 文生图接口返回值 */
  export interface TextToImageResult {
    images: string[];
    prompt: string;
    style: string;
    size: string;
    creativity: number;
    generationId: string;
    generatedAt: string;
  }
}

/**
 * 文生图API
 */
export async function textToImageApi(data: AiApi.TextToImageParams) {
  return requestClient.post<AiApi.TextToImageResult>('/ai/text-to-image', data);
} 